package com.c503.sc.mytest.java.controller;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.c503.sc.log.LoggingManager;
import com.c503.sc.mytest.common.controller.BaseController;
import com.c503.sc.utils.common.SystemContants;
import com.c503.sc.utils.response.ResultMessage;

@Scope(value = "prototype")
@Controller
@RequestMapping(value = "/mytest")
public class TestController extends BaseController {
	
	 /** 日志记录器 */
    private static final LoggingManager LOGGER =
        LoggingManager.getLogger(TestController.class);
    
	/**
     * 〈一句话功能简述〈功能详细描述〉
     *
     * @param form DeviceSpecForm对象
     * @return success
     *         :{"code":1,msg:"查询成功",data:[{"userName":"张三","position":"值班员"
     *         ,"remark":"值班室科长" }]}
     *         exception:{"code":3,"msg":"系统异常，请联系管理员",data:null}
     * @throws Exception 自定义异常 311210001 权限不足 系统异常 310000001 Java运行时异常
     * @see [类、类#方法、类#成员]
     */
    @RequestMapping(value = "/findByPage", method = RequestMethod.POST)
    @ResponseBody
    public ResultMessage findByPage(String a)
        throws Exception {
        // 记录程序进入方法调试日志
        LOGGER.debug(SystemContants.DEBUG_START, a);
        
        ResultMessage msg =new ResultMessage();
        msg.setCode(1);msg.setMsg("hellow world");
        
        LOGGER.debug(SystemContants.DEBUG_END);
        // 发送响应消息
        return msg;
    }

	@Override
	protected LoggingManager logger() {
		// TODO Auto-generated method stub
		return null;
	}

}
